package com.feiyi.app.adapter;

import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.feiyi.app.R;
import com.feiyi.app.bean.HomePageBean;
import com.feiyi.app.glideutils.GlideImgManager;
import com.feiyi.app.utils.ImageUtil;

import java.util.List;

/**
 * 作者 : wlt
 * 创建时间:  2018-07-14
 * QQ : 1346947404
 * 邮箱:wanglt_android@163.com
 * 类说明:首页推荐的频道列表
 * In me the tiger sniffs the rose
 */

public class HomePageRecommendCategoryAdapter extends BaseQuickAdapter<HomePageBean.DataBean.CategorysBean,BaseViewHolder> {

    private ImageView ivImage;

    public HomePageRecommendCategoryAdapter(int layoutResId, @Nullable List<HomePageBean.DataBean.CategorysBean> data){
        super(layoutResId,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HomePageBean.DataBean.CategorysBean item) {

        helper.setText(R.id.item_name,item.getName());
        ivImage = helper.getView(R.id.item_image);
        ImageUtil.suitDisplay(ivImage,1,1,9,1);
        GlideImgManager.loadImage(mContext,item.getCategory_logo(),ivImage);

    }
}
